home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / virtmem.exe / WORM.PAS < prev    next >
Pascal/Delphi Source File  |  1992-01-29  |  1KB  |  82 lines

  1. {Worm}
  2. {Lowest level routines.}
  3. Unit Worm;
  4.  
  5. Interface
  6.  
  7. Type
  8.  
  9.      Direction=(Up,Left,Down,Right);
  10.  
  11. Const
  12.  
  13.      {Regular key definitions.}
  14.      Esc=#27;
  15.      Return=#13;
  16.      Tab=^I;
  17.      BackSpace=^H;
  18.      {Extended key definitions.}
  19.      ShiftTab=#15;
  20.      AltV=#47;
  21.      AltT=#20;
  22.      Home=#71;
  23.      UpArrow=#72;
  24.      PgUp=#73;
  25.      LeftArrow=#75;
  26.      RightArrow=#77;
  27.      EndKey=#79;
  28.      DownArrow=#80;
  29.      PgDn=#81;
  30.      Ins=#82;
  31.      Del=#83;
  32.      CntlHome=#119;
  33.  
  34. Procedure Noise;
  35. Function TodayDate:String;
  36. {********************}
  37. Implementation
  38.  
  39. Uses CRT,DOS;
  40.  
  41. {--------------------}
  42. {Noise}
  43. {Makes the worst possible noise.}
  44. Procedure Noise;
  45.  
  46. BEGIN
  47.  
  48.   Sound(220);
  49.   Delay(50);
  50.   NoSound;
  51.  
  52. END;
  53. {--------------------}
  54. {TodayDate}
  55. {Returns a string that describes the current date in a format similar to that
  56.  of 'May 17, 1991'.  This is always a 12 character string.}
  57. Function TodayDate:String;
  58.  
  59. Const
  60.  
  61.      MonthStr:Array[1..12] of String[3]=('Jan','Feb','Mar','Apr','May',
  62.        'Jun','Jul','Aug','Sep','Oct','Nov','Dec');
  63.  
  64. Var
  65.  
  66.      Year    :Word;
  67.      Month   :Word;
  68.      Day     :Word;
  69.      DayOWeek:Word;
  70.      DayStr  :String;
  71.      YearStr :String;
  72.  
  73. BEGIN
  74.  
  75.   GetDate(Year,Month,Day,DayOWeek);
  76.   Str(Day:2,DayStr);
  77.   Str(Year,YearStr);
  78.   TodayDate:=Concat(MonthStr[Month],' ',DayStr,', ',YearStr);
  79.  
  80. END;
  81.  
  82. eND.